Proper connect_port
[juce-lv2.git] / juce / source / extras / the jucer / src / properties / jucer_ComponentTextProperty.h
blobdc41865b0f5a4dab88ecedabcb40ca0971b40b0f
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-11 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_COMPONENTTEXTPROPERTY_JUCEHEADER__
27 #define __JUCER_COMPONENTTEXTPROPERTY_JUCEHEADER__
30 //==============================================================================
31 /**
33 template <class ComponentType>
34 class ComponentTextProperty : public TextPropertyComponent,
35 private ChangeListener
37 public:
38 ComponentTextProperty (const String& name,
39 const int maxNumChars_,
40 const bool isMultiLine_,
41 ComponentType* const component_,
42 JucerDocument& document_)
43 : TextPropertyComponent (name, maxNumChars_, isMultiLine_),
44 component (component_),
45 document (document_)
47 document.addChangeListener (this);
50 ~ComponentTextProperty()
52 document.removeChangeListener (this);
55 void changeListenerCallback (ChangeBroadcaster*)
57 refresh();
60 protected:
61 ComponentType* component;
62 JucerDocument& document;
66 #endif // __JUCER_COMPONENTTEXTPROPERTY_JUCEHEADER__